package com.sunwayworld.basemodule.rm.material.resource.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.sunwayworld.basemodule.rm.material.resource.LimsStandardInventoryResource;
import com.sunwayworld.basemodule.rm.material.service.LimsStandardInventoryService;
import com.sunwayworld.framework.spring.annotation.GikamBean;
import com.sunwayworld.framework.log.annotation.Log;
import com.sunwayworld.framework.log.annotation.LogModule;
import com.sunwayworld.framework.log.annotation.LogType;
import com.sunwayworld.framework.restful.data.RestJsonWrapperBean;

@LogModule("材料库存")
@RestController
@GikamBean
public class LimsStandardInventoryResourceImpl implements LimsStandardInventoryResource {

    @Autowired
    private LimsStandardInventoryService limsStandardInventoryService;

    @Override
    public LimsStandardInventoryService getService() {
        return limsStandardInventoryService;
    }

    @Log(value = "新增材料库存", type = LogType.INSERT)
    @Override
    @RequestMapping(method = RequestMethod.POST)
    public Long insert(RestJsonWrapperBean wrapper) {
        return getService().insert(wrapper);
    }

    @Override
    public void checkOutStandard(RestJsonWrapperBean wrapper) {
        getService().checkOutStandard(wrapper);
    }

    @Override
    public void inventoryStandard(RestJsonWrapperBean wrapper) {
        getService().inventoryStandard(wrapper);
    }

    @Override
    @Log(value = "删除操作记录", type = LogType.DELETE)
    public void deleteHistory(RestJsonWrapperBean wrapper) {
        getService().deleteHistory(wrapper);
    }
}
